import cv2

img = cv2.imread('../asset/dog.jpg')
result = cv2.pyrMeanShiftFiltering(img, 20, 30)

img_canny = cv2.Canny(result, 150, 300)
controus, _ = cv2.findContours(img_canny, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
cv2.drawContours(img, controus, -1, (0, 0, 255), 2)
while True:
    cv2.imshow('img', img)
    cv2.imshow('result', result)
    cv2.imshow('img_canny', img_canny)
    key = cv2.waitKey(10)
    if key & 0xFF == ord('q'):
        break
cv2.destroyAllWindows()
